export default function MerchantApi() {
    let _u = uni.$u
    return {
        // 实名认证 信息获取
        queryMerchantDetail: function (params: any) {
            return _u.post('/merchant/merchant/queryMerchantDetail', params, {
                useMask: true
            })
        },
        // 创建 或更新 实名认证信息
        saveOrUpdate: (params: any) => {
            return _u.post('/merchant/merchant/saveOrUpdateMerchant', params, {
                useJsonParam: true
            })
        },
        // 个人信息 补全
        appUpdateMerchant: (params: any) => {
            return _u.post('/merchant/merchant/appUpdateMerchant', params, {
                useJsonParam: true
            })
        },
        appMerchantDetail: (params: any) => {
            return _u.get('/merchant/merchant/appMerchantDetail', params)
        },
        // 收货地址
        queryMerchantAddressPage: (params: any) => {
            return _u.post('/merchant/merchant-address/queryMerchantAddressPage', params)
        },
        queryDefaultAddress: (params: any) => {
            return _u.post('/merchant/merchant-address/queryDefaultAddress', params)
        },
        // 修改 新增收货地址
        saveOrUpdateAddress: (params: any) => {
            return _u.post('/merchant/merchant-address/saveOrUpdateAddress', params)
        },
        // 删除地址
        delAddress: (params: any) => {
            return _u.post('/merchant/merchant-address/delAddress', params)
        },
        // 更新商户个人信息
        updateMercantAccountInfo: (params: any) => {
            return _u.post('/merchant/merchant-account/updateMerchantAccount', params)
        },
        //发送验证码
        sendCode: (params: any) => {
            return _u.post('/merchant/merchant-account/sendVerificationCode', params, {
                useMask: true
            })
        },
        // 校验 验证码
        checkCode: (params: any) => {
            return _u.post('/merchant/merchant-account/checkVerificationCode', params, {
                useMask: true
            })
        },
        //法大大认证接口
        getAuthCompanyUrl: (params: any) => {
            return _u.post('/merchant/merchant-authentication/getAuthCompanyUrl', params, {
                useMask: true
            })
        },
        //采购 合同签署 URL
        purchaseExtSign: (params: any) => {
            return _u.post('/merchant/merchant/purchaseExtSign', params, {
                useMask: true
            })
        },
        // 授信合同签署链接
        creditExtSign: (params: any) => {
            return _u.post('/merchant/merchant-credit/creditExtSign', params, {
                useMask: true
            })
        },
        // 检查采购合同是否有效
        checkOrderContract: (params: any) => {
            return _u.post('/merchant/merchant-contract-pic/checkOrderContract', params)
        },
        // 电子合同记录
        queryMerchantContractPic: (params: any) => {
            return _u.post('/merchant/merchant-contract-pic/queryMerchantContractPic', params)
        },
        // 账期付款权限
        getCreditInfoByMerchantId: (params: any) => {
            return _u.post('/merchant/merchant-credit/getCreditInfoByMerchantId', params, {
                useMask: true
            })
        },
        // 查询授信状态
        getCreditStatus: (merchantId: string | number) => {
            return _u.post('/merchant/merchant-credit/getCreditInfoByMerchantIdCreditStatusNot4', merchantId)
        },
        // 查询商户银行账户信息
        queryMerchantBankInfo: (merchantId: string | number) => {
            return _u.post('/merchant/merchant-bank/queryMerchantBankInfo', merchantId)
        },
        // 修改密码
        modifyPassword: (params: any) => {
            return _u.post('/merchant/merchant-account/modifyPassword', params)
        },
        // 查询实名认证状态
        getMerchantStatusById(params: any) {
            return _u.post('/merchant/merchant/getMerchantById', params, {
                useMask: true
            })
        },
        // 收钱账户信息
        querySelfMerchantBank() {
            return _u.post('/merchant/merchant-bank/querySelfMerchantBank')
        },
        // 查询商户水印配置信息
        queryMerchantWatermarkConfig(params: any) {
            return _u.post('/merchant/merchant-watermark-config/queryMerchantWatermarkConfig', params, {
                useMask: true
            })
        },
        // 更新商户水印配置信息
        updateMerchantWatermarkConfig(params: any) {
            return _u.post('/merchant/merchant-watermark-config/updateMerchantWatermarkConfig', params, {
                useMask: true
            })
        },
        // 校验是否为平台用户
        checkMerchantAccountByPhone(params: any) {
            return _u.post('/merchant/merchant-account/checkMerchantAccountByPhone', params, {
                useMask: true
            })
        },
        // 判断是否显示 去签约按钮
        showSignButn(params: any) {
            return _u.post('/merchant/merchant-contract-pic/checkContractQualifications', params, {
                useMask: true
            })
        },
        // 内部客户注册成为平台用户
        changeMerchantType(params: any) {
            return _u.post('/merchant/merchant-account/changeMerchantType', params)
        },
        // 查询子账号列表
        queryAccount() {
            return _u.get('/merchant/merchant-sub-account/list')
        },
        // 新增子账号
        newAccount(params: any) {
            return _u.post('/merchant/merchant-sub-account/new-account', params, {
                useJsonParam: true
            })
        },
        //查询子账号 角色列表
        queryAccountRoles() {
            return _u.get('/merchant/merchant-sub-account/roles')
        },
        // 更新子账号信息
        updateAccount(params: any) {
            return _u.post('/merchant/merchant-sub-account/updated-account', params, {
                useJsonParam: true
            })
        },
        // 删除子账号
        delAccount(params: any) {
            return _u.post('/merchant/merchant-sub-account/deleted-account', params)
        },
        // 查询当前登录商户信息
        currentMerchantAccountInfo(params: any) {
            return _u.post('/merchant/merchant-account/queryMerchantAccountInfo', params)
        },
        // 根据id 查询账单详情
        querySettlementBillManagerDetail(id: string | number) {
            return _u.post('/settlement/settlement-bill/querySettlementBillManagerDetail', { id })
        },
        // 保存开票信息
        addInvoiceItem(params: any) {
            return _u.post('/merchant/merchant-tax/one', params, {
                useJsonParam: true
            })
        }
    }
}
